# Contributor: Renoir Boulanger <hello@renoirboulanger.com>
# Maintainer: Andy Postnikov <apostnikov@gmail.com>
pkgname=php8-pecl-mustache
_extname=mustache
pkgver=0.9.2
pkgrel=0
pkgdesc="PHP 8 extension: C++ implementation of Mustache - PECL"
url="https://pecl.php.net/package/mustache"
arch="all"
license="MIT"
depends="php8-common"
makedepends="php8-dev libmustache"
source="php-pecl-$_extname-$pkgver.tgz::https://pecl.php.net/get/$_extname-$pkgver.tgz"
builddir="$srcdir"/$_extname-$pkgver

build() {
	phpize8
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--with-php-config=php-config8 \
		--enable-mustache
	make
}

check() {
	make NO_INTERACTION=1 REPORT_EXIT_STATUS=1 test
}

package() {
	make INSTALL_ROOT="$pkgdir" install
	local _confdir="$pkgdir"/etc/php8/conf.d
	install -d $_confdir
	echo "extension=$_extname" > $_confdir/70_$_extname.ini
}

sha512sums="7a5a1a084f18cf1c45ac042bf9f2fa1f882975a5d361862034a333e5200f2df87ed34f957a31fa0994e6e53854b7529c5fffe61b13a1406847bd2475cad52ab6  php-pecl-mustache-0.9.2.tgz"
